package com.qsmx.qingqiuticket.app.delegate.back;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;

import com.qsmx.core.delegates.AtmosDelegate;
import com.qsmx.core.util.StringUtil;
import com.qsmx.core.util.storage.AtmosPreference;
import com.qsmx.qingqiuticket.app.R;
import com.qsmx.qingqiuticket.app.databinding.DelegateBackHardwareSettingBinding;
import com.qsmx.qingqiuticket.app.databinding.DelegateBackSettingBinding;
import com.qsmx.qingqiuticket.app.delegate.UsbPrintHomeDelegate;
import com.qsmx.qingqiuticket.app.delegate.back.camera.CameraTestDelegate;
import com.qsmx.qingqiuticket.app.event.RefreshSettingEvent;
import com.qsmx.qingqiuticket.app.fusion.FusionPre;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class BackHardwareSettingDelegate extends AtmosDelegate {

    private DelegateBackHardwareSettingBinding mBinding;

    @Override
    public Object setLayout() {
        return R.layout.delegate_back_hardware_setting;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, View rootView) {
        mBinding = DelegateBackHardwareSettingBinding.bind(rootView);

        onClick();
    }

    private void onClick() {

        mBinding.tvBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                getSupportDelegate().pop();
            }
        });

        mBinding.tvPrintSet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getSupportDelegate().start(new UsbPrintHomeDelegate());
            }
        });

        mBinding.tvOtherSet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getSupportDelegate().start(new BackOtherSettingDelegate());
            }
        });

        mBinding.tvCameraTest.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getSupportDelegate().start(new CameraTestDelegate());
            }
        });

    }
}
